//
//  MyRoadShowCell.m
//  BigToBig
//
//  Created by liuyi on 7/21/16.
//  Copyright © 2016 cn.cloudtp. All rights reserved.
//

#import "MyRoadShowCell.h"

@interface MyRoadShowCell ()
@property (nonatomic , strong)UIImageView *headImageView;
@property (nonatomic , strong)UILabel *titleLabel;
@property (nonatomic , strong)UILabel *describeLabel;
@property (nonatomic , strong)UILabel *statusLabel;
@property (nonatomic , strong)UILabel *timeLabel;

@end

@implementation MyRoadShowCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self createSubViews];
    }
    return self;
}


- (void)createSubViews{
    
//  上端分割线
    UILabel *firstLine = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, 2)];
    firstLine.backgroundColor = COLOR_RGBA(247, 247, 247, 1);
    [self.contentView addSubview:firstLine];
    
//  头像
    self.headImageView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, (kScreenWidth - 20)/6, (kScreenWidth - 20)/6)];
    self.headImageView.image = [UIImage imageNamed:@"touxiang"];
    [self addSubview:self.headImageView];
    self.headImageView.layer.cornerRadius = (kScreenWidth - 20)/12;
    self.headImageView.layer.masksToBounds = YES;
    
// 分类名
    UILabel *groupLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.headImageView.x, self.headImageView.maxY + 5, self.headImageView.width, self.headImageView.height / 3)];
    groupLabel.backgroundColor = COLOR_RGBA(0, 228, 161, 1);
    groupLabel.text = @"路演项目";
    groupLabel.font = [UIFont systemFontOfSize:12];
    groupLabel.textAlignment = 1;
    groupLabel.textColor = [UIColor whiteColor];
    groupLabel.layer.cornerRadius = 5;
    groupLabel.layer.masksToBounds = YES;
    [self addSubview:groupLabel];
    
// 状态
    self.statusLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth / 6 * 5, 10, kScreenWidth / 6, self.headImageView.height / 3)];
    _statusLabel.textColor = [UIColor redColor];
    [self.contentView addSubview:_statusLabel];
    
// 标题
    self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.headImageView.maxX + 10, self.headImageView.y + 10, kScreenWidth - self.headImageView.maxX - 10, self.headImageView.height /3)];
    self.titleLabel.text = @"创业生态园";
    [self addSubview:self.titleLabel];
    self.titleLabel.textAlignment = UITextAlignmentLeft;
    
// 描述
    self.describeLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.titleLabel.x, self.titleLabel.maxY + 5, self.titleLabel.width, self.titleLabel.height * 2)];
    self.describeLabel.text = @"纯天然的无污染的。好的是设计的话四大行顺觉得你 附近 那女女就 激动女我记你了解到分和笨手笨脚v我巨大风波.";
    [self addSubview:self.describeLabel];
    self.describeLabel.numberOfLines = 0;
    self.describeLabel.font = [UIFont systemFontOfSize:12];
    self.describeLabel.textColor = [UIColor lightGrayColor];
    
// 中间分隔线
    UILabel *secondLine = [[UILabel alloc]initWithFrame:CGRectMake(0, groupLabel.maxY + 10, kScreenWidth, 1)];
    secondLine.backgroundColor = COLOR_RGBA(247, 247, 247, 1);
    [self.contentView addSubview:secondLine];
    

// 速演时间
    self.timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth / 5 * 2, secondLine.maxY + 10, kScreenWidth / 5 * 3, self.headImageView.height / 3)];
    [self.contentView addSubview:self.timeLabel];
    self.timeLabel.text = @"速配时间:2016-07-18 14:25-14:40";
    self.timeLabel.font = [UIFont systemFontOfSize:12];
    self.timeLabel.textColor = [UIColor lightGrayColor];
    
}



- (void)setCellType:(BOOL)cellType{
    if (cellType) {
        self.statusLabel.text = @"未开始";
    }
    else{
        self.statusLabel.text = @"审核中";
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
